import request from "@/services/request";

/**
 * 获取异常概览AI摘要
 * @returns 异常概览AI摘要数据
 */
export function fetchAnomalyOverviewAISummary() {
  return request("/cnpc-web/supgpt-app/auto-supervision/anomaly-overview/aiAummary", {
    method: "GET",
  });
}

/**
 * 获取评估项列表
 * @param params 查询参数: { state?: number, evaluationItemName?: string, ... }
 * @returns 评估项列表数据
 */
export function fetchEvaluationItems(params: any) {
  return request("/cnpc-web/supgpt-app/auto-supervision/anomaly-overview/selectEvaluationItems", {
    method: "POST",
    data: params,
  });
}

export function updateEvaluationItem(params: any) {
  return request("/cnpc-web/supgpt-app/auto-supervision/anomaly-overview/updateEvaluationItem", {
    method: "PUT",
    data: params,
  });
}

/**
 * 获取预测值时间序列数据
 * @param params 查询参数: { startTime: string, endTime: string, evaluationItemName: string, tagName: string }
 * @returns 预测值时间序列数据
 */
export function fetchPredictedValueByTime(params: any) {
  return request("/cnpc-web/supgpt-app/auto-supervision/anomaly-overview/getPredictedValueByTime", {
    method: "POST",
    data: {
      data: params
    },
  });
}
/**
 * 趋势图-查询多个评估项位号预测值
 * @param params 查询参数: { evaluationItemName: string }
 * @returns 预测值时间序列数据
 */
export function fetchPredictedValueList(params: any) {
  return request("/cnpc-web/supgpt-app/auto-supervision/anomaly-overview/getPredictedValueList", {
    method: "POST",
    data: {
      data: params
    },
  });
}

/**
 * 获取异常分组标签映射
 * @returns 分组标签映射数据
 */
export function fetchGroupTagMap() {
  return request("/cnpc-web/supgpt-app/auto-supervision/anomaly-overview/groupTagMap", {
    method: "POST",
  });
}